﻿using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Mvc.Html;

namespace SpeadFrm.Web.Mvc
{
    public static class HtmlHelpers
    {
        public static MvcHtmlString SortOrder(this HtmlHelper htmlHelper)
        {
            var list = new List<SelectListItem>
                 {
                     new SelectListItem {Text = "降序", Value = "DESC"},
                     new SelectListItem {Text = "升序", Value = "ASC"}
                 };
            return htmlHelper.DropDownList("sortOrder", list);
        }

        public static MvcHtmlString SortKey(this HtmlHelper htmlHelper, List<SelectListItem> selectListItems)
        {
            return htmlHelper.DropDownList("sortKey", selectListItems);
        }
    }
}